import {call,put,takeEvery} from "redux-saga/effects"
import {menusApi} from "../../apis/Menus"
import {initMenuAC} from "../actions/MenusAction"

//获取菜单信息
function* checkItem({username}){
    const {data} = yield call(menusApi,username)
    //初始化菜单数据
    yield put(initMenuAC(data))
}

export default function* index(){
    yield takeEvery("getMenus",checkItem)
}